package com.sky.mapper;

import com.github.pagehelper.Page;
import com.sky.annotation.AutoFill;
import com.sky.dto.SetmealPageQueryDTO;
import com.sky.entity.Setmeal;
import com.sky.enumeration.OperationType;
import com.sky.vo.DishItemVO;
import com.sky.vo.SetmealVO;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;

import java.util.List;

@Mapper
public interface SetmealMapper {
    Page<SetmealVO> pageQuery(SetmealPageQueryDTO setmealDishMapper);
    @AutoFill(OperationType.INSERT)
    void insert(Setmeal setmeal);

    void deleteByIds(List<Long> ids);

    SetmealVO getById(Long id);
    @AutoFill(OperationType.UPDATE)
    void update(Setmeal setmeal);

    List<Setmeal> getByIds(List<Long> ids);

    List<DishItemVO> getDishsBySetmealId(Long id);

    List<Setmeal> list(Setmeal setmeal);

    @Select("select count(id) from sky_take_out.setmeal where status=#{status}")
    Integer getCountByStatus(Integer status);
}
